require 'set'

new_england = ["Connecticut","Maine","Massachusettts","New Hampshire","Rhode Island","Vermont"]
state_set = Set.new(new_england)
names = ["David","Yukihiro","Chad","Amy"]
name_set = Set.new(names) {|name| name.upcase}
puts name_set

tri_state = Set.new(["New Jersey","New York"])
tri_state << "Connecticut"
puts tri_state

tri_state << "Pennsylvania"
tri_state.delete("Connecticut")
puts tri_state

puts tri_state.add?("Pennsylvania")

tri_state = Set.new(["Connecticut","New Jersey","New York"])
puts state_set - tri_state
puts state_set + tri_state
puts state_set & tri_state
puts state_set ^ tri_state
tri_state = Set.new(["Connecticut","New Jersey"])
tri_state.merge(["New York"])

#subset子集，superset超集，proper_subset真子集，proper_superset真超集